<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: xwj
  Date: 2020-12-08
  Time: 17:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>借阅记录</title>

    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>
<div class="container">

    <div class="row clearfifx">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>借阅列表————显示所有借阅记录</small>
                </h1>
            </div>
        </div>

        <div class="row">
            <div class="col-md-4 column">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/borrow/toAddBorrow">新增借阅记录</a>
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/borrow/allBorrow">显示全部记录</a>
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/borrow/back">回到首页</a>
            </div>
            <div class="col-md-4 column">
            </div>
            <div class="col-md-4 column">
                <form class="form-inline" action="${pageContext.request.contextPath}/borrow/querBorrow" method="post" style="float: right">
                    <span style="color:red;font-weight: bold">${error}</span>
                    <input type="text" name="queryReadersNo" class="form-control" placeholder="请通过读者编号进行查询">
                    <input type="submit" value="查询" class="btn btn-primary">
                </form>
            </div>
        </div>
    </div>


    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <th>图书编号</th>
                <th>读者编号</th>
                <th>借阅日期</th>
                <th>借阅数量</th>
                <th>操作</th>
                </thead>
                <tbody>
                <c:forEach var="borrow" items="${list}">
                    <tr>
                        <td>${borrow.bookNo}</td>
                        <td>${borrow.readersNo}</td>
                        <td>${borrow.borrowDate}</td>
                        <td>${borrow.borrowNumber}</td>
                        <td><a href="${pageContext.request.contextPath}/borrow/toUpdate?id=${borrow.borrowID}">归还部分</a>
                            &nbsp; | &nbsp;
                            <a href="${pageContext.request.contextPath}/borrow/updateBorrow2/${borrow.borrowID}">归还全部</a>
                            &nbsp; | &nbsp;
                            <a href="${pageContext.request.contextPath}/borrow/deleteBorrow/${borrow.borrowID}">删除</a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>
